xmartin

Section: User Commands (1)
Updated: 20 July 1991
Index Return to Main Contents
 

NAME

xmartin - set X root window to Martin hopalong pattern  

SYNOPSIS

xmartin  [options]
xmartin+  [options]
 

DESCRIPTION

Xmartin sets the X root window to a hopalong pattern. Xmartin+ is an optional front end. The hopalong algorithm was attributed to Barry Martin of Aston University (Birmingham, England) in A. K. Dewdney's Computer Recreations column in the September 1986 Scientific American. The cp1 sine sculpture functions were published by Clifford Pickover in the January 1991 Algorithm. The rr1 function was developed by Renaldo Recuerdo of the Santa Cruz Operation.  

OPTIONS

-f function
Requests a specific hopalong function: martin1, martin2, ejk1, ..., ejk6, rr1, or cp1. By default, a function is selected at random. xmartin+ allows tailoring probabilities that a function will be selected. (See FRONT END below.)

Note: cp1 is actually a family of roughly 2.8e19 functions with the highest-order exponent ranging from 1 to 16 and requested by -f cp1,order. Within a cp1 order, there are 16**order function permutations. A specific permutation is requested by -f cp1,order,xn,yn, where xn and yn are integers from 0 to (4**order)-1.

-a -b -c -d -x -y { r | r:r | r::r }
Sets the corresponding hopalong parameter to the real value r or to a random value in the range r:r or r::r. Two colons indicate a plus-or-minus range. For example, -100:1e3 means a value between -100 and 1000, while 1::3 means a value between 1 and 3 or between -1 and -3. abcd are constants, while xy are the coordinates of the starting point for the calculation. By default, random values are assigned for abcd. The ranges for default random values can be tailored with the xmartin+ front end described below.
-p n -P n
Sets maximum points to calculate to n. -p sets the maximum for in-range (i.e. on display) points. -P sets the total points to calculate. Defaults: -p: 25% of pixels in server display (or tile). -P: 3 times the -p value. Values of 100 or less are interpreted as percent of pixels in display or tile.
-dynam [ nd ]
Sets the number of points calculated before display. Default is -dynam 1024 (128 if -tile is selected.)
-static
Display after all points calculated.
-tile [ XxY ]
Requests that the root window be tiled with a pattern smaller than the entire display. XxY, if present, requests a specific tiling pattern. For example, -tile 3x4 requests a tile size of 1/3 the display width and 1/4 the display height. A random XxY is used if not supplied. This option substantially reduces calculation time and memory requirements for the pattern.
-perturb [ n[,v] ]
Perturbs the calculation every n points by offsetting the current x and y values by v. If v or n are not supplied, random values are used.
-coord { xy | yx | ra | ar }
Coordinate mode. Calculation (x,y) interpreteted as (x,y), (y,x), (radius,angle), or (angle,radius). Default is xy except for -f cp1, where one of the four is selected at random.
-zoom z
Multiplies calculation coordinates by z before display. Thus, z > 1 magnifies, and z < 1 reduces. Defaults to an appropriate value for the selected function.
-move d,p
Moves the pattern p pixels in the direction d. The direction d is either a compass degree heading (0 = north, 90 = east, 180 = south, etc), or the common abbreviations ('n', 'sw', 'nnw', etc.) Thus, for example, -move ne,300 moves the pattern 300 pixels toward the upper right corner.
-recall
Recalls hopalong parameters (-f, -a, -b, -c, -d, -x, -y, -zoom, -move, -tile, -perturb) from the last pattern before processing any other arguments. Thus, for example, -recall -zoom 0.5 -perturb will zoom out and add random perturbation to the previous pattern. The recall parameters are saved in $HOME/.xmartin. A pattern generated with -recall is not itself saved.
-bg color[,intensity]
Requests a specific background color for the pattern. If present, intensity (a value from 0.0 to 1.0) specifies the color intensity. For example, -bg blue,0.20 yields a very dark blue background. By default, random low intensity color backgrounds are used (see RESOURCES below.)
-nc n
For color or grayscale displays, sets the number of points to calculate before changing colors. (Default: 1/16th of -P value, except for -f cp1 on color displays, where the default is the -P value.)
-nrc
Non-random color sequence.
+rv -rv
Requests black-on-white or white-on-black patterns respectively. -rv (white-on-black) is the default for monochrome displays.
-mono
Forces white-on-black for a grayscale or color displays.
-v
Prints xmartin version and patch level.
 

FRONT END

On systems with perl installed, the xmartin+ front end may be used to invoke xmartin with probabilities and parameters tailored to your preferences, or to save or request interesting parameter sets by name. Tailored parameters and recorded values are stored in $HOME/.xmartin+. If you don't have a .xmartin+ file, one with comments and examples is created.
-q
Prints table of .xmartin+ entry names, weights, and comments.
-demo
Executes each entry once.
-n name [-n name] ...
Requests pattern(s) by name. (Also -f)
-repeat [seconds]
Generates patterns indefinitely (until ^C), pausing the requested number of seconds between each pattern. Thus xmartin+ -repeat 300 -tile will generate a random tiled background about every 5 minutes.
-save
Saves the exact hopalong parameters for the previous pattern in the .xmartin+ file so it can be recalled later with xmartin+ -n name. You will be prompted for the name and a brief comment.
-file file
Requests a file other than ~/.xmartin+.

All xmartin parameters (except -recall) are also accepted, so you can add to or alter options generated by xmartin+.  

RESOURCES

For color or grayscale displays, xmartin honors the following resource for background color:

xmartin*background: color[,intensity]

Intensity, if present, is a real number from 0.0 to 1.0 which indicates the intensity of the color desired (default: 1.0). Another permissable value for this resource is random (the default) which selects one of the 16 background resources below.

For color displays, xmartin honors the following resources for foreground and random background colors (shown with default values):

xmartin*Color1: red
xmartin*Color2: green
xmartin*Color3: blue
xmartin*Color4: yellow
xmartin*Color5: magenta
xmartin*Color6: cyan
xmartin*Color7: coral
xmartin*Color8: slate blue
xmartin*Color9: orange red
xmartin*Color10: spring green
xmartin*Color11: orange
xmartin*Color12: steel blue
xmartin*Color13: pink
xmartin*Color14: violet
xmartin*Color15: firebrick
xmartin*Color16: gold

xmartin*bgColor1: black
xmartin*bgColor2: white,.20
xmartin*bgColor3: white,.25
xmartin*bgColor4: white,.30
xmartin*bgColor5: white,.35
xmartin*bgColor6: blue,.20
xmartin*bgColor7: blue,.25
xmartin*bgColor8: blue,.30
xmartin*bgColor9: red,.25
xmartin*bgColor10: red,.30
xmartin*bgColor11: red,.35
xmartin*bgColor12: green,.25
xmartin*bgColor13: green,.30
xmartin*bgColor14: cyan,.20
xmartin*bgColor15: cyan,.25
xmartin*bgColor16: cyan,.30

For grayscale displays, xmartin honors the following resources for foreground and random background shades (shown with default values):

xmartin*Gray1: white
xmartin*Gray2: white,.96
xmartin*Gray3: white,.92
xmartin*Gray4: white,.88
xmartin*Gray5: white,.84
xmartin*Gray6: white,.80
xmartin*Gray7: white,.76
xmartin*Gray8: white,.72
xmartin*Gray9: white,.68
xmartin*Gray10: white,.64
xmartin*Gray11: white,.60
xmartin*Gray12: white,.56
xmartin*Gray13: white,.52
xmartin*Gray14: white,.48
xmartin*Gray15: white,.44
xmartin*Gray16: white,.40

xmartin*bgGray1: black
xmartin*bgGray2: white,.02
xmartin*bgGray3: white,.04
xmartin*bgGray4: white,.06
xmartin*bgGray5: white,.08
xmartin*bgGray6: white,.10
xmartin*bgGray7: white,.12
xmartin*bgGray8: white,.14
xmartin*bgGray9: white,.16
xmartin*bgGray10: white,.18
xmartin*bgGray11: white,.20
xmartin*bgGray12: white,.22
xmartin*bgGray13: white,.24
xmartin*bgGray14: white,.26
xmartin*bgGray15: white,.28
xmartin*bgGray16: white,.30

Foreground colors and grays are used in the order above if -nrc is used. Otherwise they are used in a random order. Color is changed every -nc n points during the calculation.  

ALGORITHMS

The basic algorithm for all patterns is:

        {pick initial x,y and constants A,B,...}
        while(not enough points) {
           x1 = X1(x,y);
           y1 = Y1(x,y);
           x = x1; y=y1;
           plot(x,y);
           }


martin1:
x1 = y  - ( (x<0) ? sqrt(fabs(B*x-C)) : -sqrt(fabs(B*x-C)) );
y1 = A - x;

martin2:
x1 = y  - sin(x);
y1 = A - x;

ejk1:
x1 = y  - ( (x>0) ? (B*x-C) : -(B*x-C) );
y1 = A - x;

ejk2:
x1 = y  - ( (x<0) ? log(fabs(B*x-C)) : -log(fabs(B*x-C)) );
y1 = A - x;

ejk3:
x1 = y  - ( (x>0) ? (sin(B*x)-C) : -(sin(B*x)-C) );
y1 = A - x;

ejk4:
x1 = y  - ( (x>0) ? (sin(B*x)-C) : -sqrt(fabs(B*x-C)) );
y1 = A - x;

ejk5:
x1 = y  - ( (x>0) ? (sin(B*x)-C) : -(B*x-C) );
y1 = A - x;

ejk6:
x1 = y  - asin(fmod(B*x, 1.0));
y1 = A - x;

rr1:
x1 = y  - ( (x<0) ? -pow(fabs(B*x-C), D) : pow(fabs(B*x-C), D) );
y1 = A - x;

cp1:
x1 = sin(p1) + sin(p2)*sin(p2) + sin(p3)*sin(p3)*sin(p3) + ...
y1 = sin(q1) + sin(q2)*sin(q2) + sin(q3)*sin(q3)*sin(q3) + ...

Each pn or qn is either A*x, A*y, B*x, or B*y.

 

BUGS

On some systems, certain parameter combinations cause xmartin to abort with a floating point exception. (The neuron pattern defined by xmartin+ is an example.)  

AUTHOR

Ed Kubaitis, Computing Services Office, University of Illinois.


 

Index

NAME
SYNOPSIS
DESCRIPTION
OPTIONS
FRONT END
RESOURCES
ALGORITHMS
BUGS
AUTHOR

This document was created by man2html, using the manual pages.
Time: 20:43:44 GMT, June 11, 2022